<?php
import('ORG.Util.Page');
class PageEx extends Page{
	public function show($isArray=false){
		if(0 == $this->totalRows) return;
		$nowCoolPage      = ceil($this->nowPage/$this->rollPage);
		$url  =  $_SERVER['REQUEST_URI'].(strpos($_SERVER['REQUEST_URI'],'?')?'':"?").$this->parameter;
		$select='';
		$iterate=$this->totalPages;
		while($iterate){
			if($iterate!=$this->nowPage){
				$select='<option value="'.$iterate.'">'.$iterate.'</option>'.$select;
			}
			$iterate--;
		}
        $pageEx='&'.C('VAR_PAGE').'=';
		$pageStr='<label>共'.$this->totalRows.$this->config['header'].'/'.$this->totalPages.'页,当前第'.$this->nowPage.'页</label>';
		if($select){
			$pageStr.='<script type="text/javascript">function gotoPage(p){if(p==0)return;else window.location="'.$url.$pageEx.'"+p;}</script>,跳转到&nbsp;<select onchange="gotoPage(this.options[this.selectedIndex].value)"><option value="0">请选择</option>'.$select.'</select>';
		}
		return $pageStr;
	}
}